package com.atguigu.userprofile.dao;

import com.atguigu.userprofile.bean.TaskInfo;
import com.atguigu.userprofile.util.MySqlUtil;

/**
 * 负责TaskInfo的增删改查
 */
public class TaskInfoDao {

    /**
     *  通过任务id查询TaskInfo
     */
    public  static TaskInfo selectTaskInfoById( String id ) {
        String querySql ="SELECT \n" +
                "id , task_name , task_status , task_comment , task_time ,task_type , exec_type ,\n" +
                "main_class , file_id , task_args ,task_sql , task_exec_level , create_time \n" +
                "FROM \n" +
                "task_info \n" +
                "WHERE id = " + id ;
        TaskInfo taskInfo = MySqlUtil.selectOne(querySql, TaskInfo.class, true);
        return taskInfo ;
    }
}
